package ycl.time.task;

import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import ycl.time.feign.MessageFeign;

import javax.annotation.Resource;

/**
 * redis定时器
 *
 * @author ycl
 * @date 2022/6/18 0018 11:04:11
 */
@Configuration
@EnableScheduling//开启定时器
@Slf4j
public class RedisTask {

	@Resource
	private MessageFeign messageFeign;

	/**
	 * 每天 05:00 执行
	 */
	@Scheduled(cron = "0 0 5 * * ?")
	public void clearGetEmailCount() {
		messageFeign.clearGetEmailCount();
		log.info("ycl-schedule RedisTask success --- ");
	}
}
